package com.hoshiicloud.rbac.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 权限
 * </p>
 *
 * @author Mr.Wu
 * @since 2019-04-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "SysPermissiones对象", description = "权限")
@TableName("sys_permissiones")
public class SysPermissiones extends Model<SysPermissiones> {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "id", hidden = true)
	@TableId(value = "id")
	private Long id;

	@ApiModelProperty(value = "所属功能模块")
	private Long systemId;

	@ApiModelProperty(value = "关联系统id")
	@TableField("ref_id")
	private Long refId;

	@ApiModelProperty(value = "关联系统类型")
	@TableField("ref_type")
	private String refType;

	@ApiModelProperty(value = "所属上级")
	@NotNull
	private Long pId;

	@ApiModelProperty(value = "名称")
	private String name;

	@ApiModelProperty(value = "类型(1:目录,2:菜单,3:按钮)")
	private Integer type;

	@ApiModelProperty(value = "权限值")
	private String permissionValue;

	@ApiModelProperty(value = "路径")
	private String uri;

	@ApiModelProperty(value = "图标")
	private String icon;

	@ApiModelProperty(value = "状态(0:禁止,1:正常)")
	@NotNull
	private Integer status;

	@ApiModelProperty(value = "排序")
	@NotNull
	private Long orders;

	@ApiModelProperty(value = "创建时间", hidden = true)
	private LocalDateTime createdTime;

	@ApiModelProperty(value = "更新时间", hidden = true)
	private LocalDateTime updatedTime;

	@ApiModelProperty(value = "版本号", hidden = true)
	private Integer version;

	@ApiModelProperty(value = "建立人")
	private String createdBy;

	@ApiModelProperty(value = "修改人")
	private String modifiedBy;

	@Override
	protected Serializable pkVal() {
		return this.id;
	}


}
